<template>
  <div class="return-manage">
    <el-table :data="returns" height="calc(100vh - 180px)" stripe>
      <el-table-column prop="returnNo" label="退货单号" width="200" />
      <el-table-column prop="orderNo" label="原订单号" width="200" />
      <el-table-column prop="reason" label="退货原因" width="300" />
      <el-table-column label="处理状态" width="120">
        <template #default="{ row }">
          <el-tag :type="row.status === '待处理' ? 'warning' : 'success'">
            {{ row.status }}
          </el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup>
// 生成50条退货数据
const returns = Array.from({ length: 50 }, (_, i) => ({
  returnNo: `TH${2023000 + i}`,
  orderNo: `DD2023${String(i+1).padStart(5, '0')}`,
  reason: ['质量问题', '七天无理由', '发错货'][i % 3],
  status: Math.random() > 0.3 ? '待处理' : '已完成'
}))
</script>